const express = require('express')
const Game = require(process.cwd() + '/src/class/index')

let router = express.Router()

/* GET users listing. */
router.post('/', function(req, res) {
  let env = new Game.Env()
  // 创建文件
  env.init(req.body.env).then(() => {
    return env.save()
  })
  .then(() => {
    res.sendStatus(200)
  })
  .catch((err) => {
    console.log(err)
    res.sendStatus(500)
  })
})

module.exports = router
